package cn.yuanqiao.archive.detection.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 四性检测记录对象 YQ_INSPECTION_RECORDS
 *
 * @author xy
 * @date 2023-08-07
 */
public class InspectionRecords extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    public static final String BIGTABLENAME = "_YQ_INSPECTION_RECORDS";

    public InspectionRecords() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
          //  throw new ServiceException("tenantCode is null");
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }
    /** id */

    private Long id;

    /** 检测环节 */
    @Excel(name = "检测环节")
    private String detectionLink;

    /** 检测结果 */
    @Excel(name = "检测结果")
    private String detectionResult;

    /** 检测时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Excel(name = "检测时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date detectionTime;

    /** 是否删除 */
    @Excel(name = "是否删除")
    private Integer isDel;

    /** 门类Id */
    private Long categoryId;
    private String detectionDh;
    private String tableName;

    private Long createId;


    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setDetectionLink(String detectionLink)
    {
        this.detectionLink = detectionLink;
    }

    public String getDetectionLink()
    {
        return detectionLink;
    }
    public void setDetectionResult(String detectionResult)
    {
        this.detectionResult = detectionResult;
    }

    public String getDetectionResult()
    {
        return detectionResult;
    }
    public void setDetectionTime(Date detectionTime)
    {
        this.detectionTime = detectionTime;
    }

    public Date getDetectionTime()
    {
        return detectionTime;
    }
    public void setIsDel(Integer isDel)
    {
        this.isDel = isDel;
    }

    public Integer getIsDel()
    {
        return isDel;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    @Override
    public Long getCategoryId() {
        return categoryId;
    }

    @Override
    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public String getDetectionDh() {
        return detectionDh;
    }

    public void setDetectionDh(String detectionDh) {
        this.detectionDh = detectionDh;
    }

    public Long getCreateId() {
        return createId;
    }

    public void setCreateId(Long createId) {
        this.createId = createId;
    }



    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("detectionLink", getDetectionLink())
            .append("detectionResult", getDetectionResult())
            .append("detectionTime", getDetectionTime())
            .append("isDel", getIsDel())
            .toString();
    }
}
